<template>
	<view>
		<u-navbar @leftClick="handleBack" :autoBack="true" :border="false" bgColor="#ffffff00" fixed>
			<template #center>
				<view class="centertitle">{{title}}</view>
			</template>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		name:"navbar",
		data() {
			return {
				
			};
		},
		props:{
			title:{
				type:String,
				default:""
			}
		},
		methods:{
			handleBack(e){
				if(getCurrentPages().length<2){
					uni.redirectTo({
						url:'/pages/index/index'
					})
				}else{
					uni.navigateBack()
				}
			}
		}
	}
</script>

<style lang="scss">
.centertitle{
	color: #063506;
	font-size: 36rpx;
	font-weight: 600;
}
</style>